package com.example.hrmsmy.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName departments
 */
@TableName(value ="departments")
@Data
public class Departments implements Serializable {
    /**
     * 部门编号（主键）
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 部门名称
     */
    private String departmentname;

    /**
     * 位置
     */
    private String address;

    /**
     * 上级部门编号
     */
    private Integer parentdepartmentid;

    /**
     * 最后操作时间
     */
    private Date lastoperationtime;

    /**
     * 0是false,1是ture
     */
    private String isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Departments other = (Departments) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDepartmentname() == null ? other.getDepartmentname() == null : this.getDepartmentname().equals(other.getDepartmentname()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getParentdepartmentid() == null ? other.getParentdepartmentid() == null : this.getParentdepartmentid().equals(other.getParentdepartmentid()))
            && (this.getLastoperationtime() == null ? other.getLastoperationtime() == null : this.getLastoperationtime().equals(other.getLastoperationtime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDepartmentname() == null) ? 0 : getDepartmentname().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getParentdepartmentid() == null) ? 0 : getParentdepartmentid().hashCode());
        result = prime * result + ((getLastoperationtime() == null) ? 0 : getLastoperationtime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", departmentname=").append(departmentname);
        sb.append(", address=").append(address);
        sb.append(", parentdepartmentid=").append(parentdepartmentid);
        sb.append(", lastoperationtime=").append(lastoperationtime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}